<!DOCTYPE html>
<html class="index_body">
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=10">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <title></title>
    <link rel="stylesheet" href="/Public/mui/computer/css/bootstrap.css"/>
    <link rel="stylesheet" href="/Public/mui/computer/css/index.css"/>
    <link rel="stylesheet" href="/Public/mui/css/page.css"/>
    <link rel="stylesheet"  href="/Public/mui/static/bower_components/sweetalert/dist/sweetalert.css">
    <link rel="stylesheet" type="text/css" href="/Public/mui/modalframe/css/default.css" />
    <link rel="stylesheet" type="text/css" href="/Public/mui/modalframe/css/component.css" />
</head>
<body class="index_body">
<include file="Lay:heder" />
<div id="section">
    <div class="mask-layer" style="display: none">
        <div class="mask-layer-black"></div>
        <div class="mask-layer-container">
            <div class="mask-layer-container-operate">
                <button class="mask-out btn-default-styles">放大</button>
                <button class="mask-in btn-default-styles">缩小</button>
                <button class="mask-clockwise btn-default-styles">顺旋转</button>
                <button class="mask-counterclockwise btn-default-styles">逆旋转</button>
                <button class="mask-close btn-default-styles">关闭</button>
            </div>
            <div class="mask-layer-imgbox auto-img-center">
                <p>
                    <img id="imgmodeltanchu" src="" alt="" style="width: 620px; margin-top: 43.5px;height: 100%">
                </p >
            </div>
        </div>
    </div>
    <div class="mask-layer-pdf" style="display: none">
        <div class="mask-layer-black"></div>
        <div class="mask-layer-container">
            <div class="mask-layer-container-operate">
                <button class="mask-close delpdflis" style="background:#8C85E6;">关闭</button>
            </div>
            <div class="mask-layer-imgbox auto-img-center">
                <embed  src="" id="review" style="width: 620px; margin-top: 43.5px;height: 100%">
                </embed>
                <!-- <p>
                    <img  src="" alt="" style="width: 620px; margin-top: 43.5px;height: 100%">
                </p > -->
            </div>
        </div>
    </div>
    <table class="table table-hover all_table table-striped">
        <thead class="all_thead">
        <tr>
            <th>合同编号</th>
            <th>支付时间</th>
            <th>支付金额</th>
            <th>定金金额</th>
            <th>定金是否确认</th>
            <th>客户姓名</th>
            <th>银行名称</th>
            <th>银行账户名</th>
            <th>银行卡号</th>
            <th>手续员姓名</th>
            <th>顾问姓名</th>
            <th>所属省份</th>
            <th>所属城市</th>
            <th>订单编号</th>
            <th>支付凭证</th>
            <th>合同</th>
            <th>签约面照</th>
            <th>车型</th>
            <th>状态</th>
            <th>流程查看</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="tbodyQ table_hover">
        <foreach name="order_data" item="v">
            <tr>
                <td class="tdt">{{$v['contract']}}</td>
                <td class="tdt">{{$v['pay_time']}}</td>
                <td class="tdt">{{$v['firstpaymonthpay']}}</td>
                <td class="tdt">{{$v['depositnum']}}</td>
                <td class="tdt">{{$v['deposit_text']}}</td>
                <td class="tdt">{{$v['customername']}}</td>
                <td class="tdt">{{$v['bank']}}</td>
                <td class="tdt">{{$v['banker']}}</td>
                <td class="tdt">{{$v['banknum']}}</td>
                <td class="tdt">{{$v['actionname']}}</td>
                <td class="tdt">{{$v['GWname']}}</td>
                <td class="tdt">{{$v['provinceid']}}</td>
                <td class="tdt">{{$v['cityname']}}</td>
                <td class="tdt">{{$v['orderid']}}</td>
                <!-- <td class="tdt">图1,图2</td> -->
                <td><if condition="$v['count'] gt 0">
                        <for start="0" end="$v['count']">
                            <!-- <a href="{{$user_data['workproof_url'][$i]}}" target="_blank">图 {{$i+1}}</a> -->
                            <a class="md-trigger" data-modal="modal-1" onclick="ejectmodel('/Public/Uploads/payment/{{$v['uid']}}/{{$v['payment_voucher_url'][$i]}}')">图{{$i+1}}</a>
                        </for>
                         <else />
                        暂无图片
                    </if>
                </td>
                <td>
                    <if condition="$v['contract_url']">
                        <a class="md-trigger" data-modal="modal-1" onclick="ejectepdf('/Public/Uploads/payment/{{$v['uid']}}/contract_url/{{$v['contract_url']}}')">融资合同</a>
                        <else />
                        暂无融资合同
                    </if>
                    <if condition="$v['financelease_contract_url']">
                        <a class="md-trigger" data-modal="modal-1" onclick="ejectepdf('/Public/Uploads/payment/{{$v['uid']}}/contract_url/{{$v['financelease_contract_url']}}')">抵押合同</a>
                        <else />
                        暂无抵押合同
                    </if>
                </td>
                <td>
                    <if condition="$v['facesigncount'] gt 0">
                        <for start="0" end="$v['facesigncount']">
                            <a class="md-trigger" data-modal="modal-1" onclick="ejectmodel('/Public/Uploads/payment/{{$v['uid']}}/{{$v['facesign_url'][$i]}}')">图{{$i+1}}</a>
                        </for>
                        <else />
                        暂无照片
                    </if>
                </td>
                <td class="tdt"><a href="javascript:funshow('modal_t{{$v['orderid']}}');">{{$v['cartype']}}</a></td>
                <!-- <td class="tdt">{{$v['jdc_price']}}</td> -->
                <td class="tdt">{{$v['statustext']}}</td>
                <td class="tdt"><a href="/admin/order/orderProgress?orderid={{$v['orderid']}}&isyy=true">查看进度</a></td>
                <td>
                    <if condition="$v['deposit_state'] eq 1">
                        <button type="button" onclick="depositConfirm({{$v['orderid']}},{{$v['cityid']}},this)" class="btn btn-success navbar-btn bnt_clo">定金确认</button>
                    </if>
                    <button type="button" onclick="Receivables({{$v['orderid']}},{{$v['cityid']}},this)" class="btn btn-success navbar-btn bnt_clo">确认收款</button>
                </td>
            </tr>
            <div class="modal_t modal_t{{$v['orderid']}}" style="display: none;">
                <div class="modal_k" style="overflow:scroll;height:300px;">
                       <ul style="margin-top: 15px;margin-left: 20px;position: relative;">
                       <a href="javascript:funhide('modal_t{{$v['orderid']}}');" style="position: absolute;top:-8px;right:-15%;">X</a>
                       <!--  <li>
                            <label>车辆编号：</label>
                            <span>{{$v['carnum']}}</span>
                        </li> -->
                        <li style="margin-top: 15px;">
                            <label>品牌：</label>
                            <span>{{$v['carbrand']}}</span>
                        </li>
                        <li style="margin-top: 15px;">
                            <label>车型：</label>
                            <span>{{$v['cartype']}}</span>
                        </li>
                        <li style="margin-top: 15px;">
                            <label>车辆名称：</label>
                            <span>{{$v['carname']}}</span>
                        </li>
                        <li style="margin-top: 15px;">
                            <label>颜色：</label>
                            <span>{{$v['carcolor']}}</span>
                        </li>
                        <li style="margin-top: 15px;">
                            <label>服务费：</label>
                            <span>{{$v['first_pay']}}</span>
                        </li>
                        <li style="margin-top: 15px;">
                            <label>月供：</label>
                            <span>{{$v['month_pay']}}</span>
                        </li>
                        
                       </ul>
                </div>
            </div>
        </foreach>
        </tbody>
        <div class="dao_Exe">
            <button type="button" onclick="ExcelExport(1);" class="btn btn-info">导出Excel</button>
        </div>
    </table>
    <include file="News:news" />
    <nav aria-label="Page navigation" class="pagin">
        <div class ="black2">{{$show}}</div>
    </nav>

    <script src="/Public/mui/computer/js/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="/Public/mui/static/bower_components/sweetalert/dist/sweetalert.min.js"></script>
    <script type="text/javascript" src="/Public/mui/computer/js/functions.js"></script>
    <script src="/Public/mui/computer/js/back.js"></script>
    <!-- <script src="/Public/mui/modalframe/js/classie.js"></script>
    <script src="/Public/mui/modalframe/js/modalEffects.js"></script> -->
    <script src="/Public/mui/computer/js/enlarge.js"></script>
    <script>
        DingdanConfirm();
        function DingdanConfirm(){
            $(parent.frames["leftFrame"].document).find(".click_control").removeClass("active_p ");
            $(parent.frames["leftFrame"].document).find("#information").prev().addClass("active_p");
            $(parent.frames["leftFrame"].document).find(".menuson ").addClass("hidden_l").removeClass("show_l");
            $(parent.frames["leftFrame"].document).find("#infohidd").addClass("active");
            $(parent.frames["leftFrame"].document).find("#infohidd").siblings().removeClass("active");
            $(parent.frames["leftFrame"].document).find("#information").addClass("show_l").removeClass("hidden_l");
        }
        $("#logo_type").attr("src","/Public/mui/computer/img/caiwu.png");
        // $(parent.frames["leftFrame"].document).find("#information").css("display","block");
        // $(parent.frames["leftFrame"].document).find("#infohidd").attr("class","active");
        function Receivables(orderid,carnum,this_){
            var orderid = orderid;
            var carnum = carnum;
            if(orderid ==""){
                sweetAlert('为获取到订单号');return false;
            }
            if(carnum ==""){
                sweetAlert('为获取到车辆编号');return false;
            }
            swal({ 
              title: "确定收款吗？", 
              text: "收款成功后将无法修改！", 
              type: "warning",
              showCancelButton: true, 
              confirmButtonColor: "#DD6B55",
              cancelButtonText: "返回",
              confirmButtonText: "确定收款！", 
              closeOnConfirm: false
            },
            function(){
                 post("/admin/order/financeConfirm",{orderid:orderid,carnum:carnum},function(res){
                    if(res['ret'] == 1){
                        sweetAlert({
                            title:"",
                            text: "收款成功",
                            timer: 2000,
                            showConfirmButton: false
                        });
                        setTimeout(function(){location.href='/admin/order/OrderPayConfirm'},2000);
                        // $(this_).parents('tr').remove();
                    }else if(res['ret'] == 0){
                        sweetAlert("",res['msg'],"error");
                        return false;
                    }else{
                        sweetAlert("","操作错误,请重新登录","error");
                        return false;
                    }
                },'json');
            });
        }
        function funshow(cl) {
            $('.'+cl).css('display','block');
        }
        function funhide(cl) {
            $('.'+cl).css('display','none');
        }

        function depositConfirm(orderid, carnum, this_)
        {
            swal({ 
              title: "定金确认？", 
              text: "成功后将无法修改！", 
              type: "warning",
              showCancelButton: true, 
              confirmButtonColor: "#DD6B55",
              cancelButtonText: "返回",
              confirmButtonText: "定金确认！", 
              closeOnConfirm: false
            },function(){
                 post("/admin/order/orderDepositConfirm",{orderid:orderid,carnum:carnum},function(res){
                    if(res['success'] == 'OK'){
                        sweetAlert({
                            title:"",
                            text: "定金确认成功",
                            timer: 2000,
                            showConfirmButton: false
                        });
                        setTimeout(function(){location.href='/admin/order/OrderPayConfirm'},2000);
                        // $(this_).parents('tr').remove();
                    }else if(res['error'] == 'error'){
                        sweetAlert("",res['message'],"error");
                        return false;
                    }else{
                        sweetAlert("","操作错误,请重新登录","error");
                        return false;
                    }
                },'json');
            });
        }
    var adminshowznum1 = 0;
    function ejectmodel(id){
        document.getElementById("imgmodeltanchu").src=id;
        $('.mask-layer').show();
    }
    
     function ejectepdf(id){
        document.getElementById("review").src=id;
        $('.mask-layer-pdf').show();
    }
    $("body").delegate(".images_content>img","click",function(){
        adminshowznum1 ++;
        this.style.transform = 'rotate('+90*adminshowznum1+'deg)';
    });
    $(".delpdflis").on('click',function(){
        $('.mask-layer-pdf').hide();
    })
    </script>
</div>
</body>
</html>
